<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ page import="javax.servlet.*" %>

<!DOCTYPE html>
<!-- 登录页面 -->
<html>
	<head>
		<meta charset="utf-8">
		<title>登录</title>
		<script type="text/javascript" src="/Project1/js/jquery-1.9.1.min.js"></script>
	</head>
	<body bgcolor="blanchedalmond">
		<div style="position: absolute; left: 50%;top: 50%;
		 margin-left: -150px;margin-top: -150px; width: 
		300px;height: 300px;background-color: whitesmoke">
			<h3 style="text-align: center;margin-top: 20%;">登录系统</h3>
			<input type="text" style="height: 20px;width: 180px;margin-left: 60px;margin-top: 20px;" placeholder="请输入用户名" id="name">
			<input type="password" style="height: 20px;width: 180px;margin-left: 20%;margin-top: 20px;" id="password" placeholder="请输入密码">
			<br>
			<button style="width: 190px;margin-left: 20%;margin-top: 20px;" onclick="jump()">登录</button>
		</div>
	</body>
	<script type="text/javascript">
	function jump(){
		if($("#name").val()=="xzl"&&$("#password").val()=="123"){
			alert("登录成功");
			$.ajax({
				url:"<%=request.getContextPath()%>/l",//请求路径
				type:"post",//请求方式get/post
				data: "method=loginCheck",//请求发送的数据{"method":"ms", "collegeId":id} json格式
				success:function(obj){
				window.location.href = "<%=request.getContextPath() %>/s";					
				}
			});
			
		}
		else{
			alert("登录失败");
			alert($("#name").val()+$("#password").val())
		}
	}
	</script>		
</html>